﻿using System.Xml.Serialization;
using Harvest.Api.Types;

namespace Harvest.Api.Model.Internal
{

//  <user>
//    <cache-version type="integer">2790414103</cache-version>
//    <created-at type="datetime">2009-04-08T06:23:22Z</created-at>
//    <default-expense-category-id type="integer">185635</default-expense-category-id>
//    <default-expense-project-id type="integer">855102</default-expense-project-id>
//    <default-hourly-rate type="decimal" nil="true"></default-hourly-rate>
//    <default-task-id type="integer">279637</default-task-id>
//    <default-time-project-id type="integer">855102</default-time-project-id>
//    <department nil="true"></department>
//    <duplicate-timesheet-wants-notes type="boolean">false</duplicate-timesheet-wants-notes>
//    <email>thommy@mewes.org</email>
//    <email-after-submit type="boolean">true</email-after-submit>
//    <first-name>Thommy</first-name>
//    <first-timer type="boolean">false</first-timer>
//    <has-access-to-accounting type="boolean">false</has-access-to-accounting>
//    <has-access-to-all-future-projects type="boolean">true</has-access-to-all-future-projects>
//    <id type="integer">74045</id>
//    <identity-url nil="true"></identity-url>
//    <is-active type="boolean">true</is-active>
//    <is-admin type="boolean">true</is-admin>
//    <is-contractor type="boolean">false</is-contractor>
//    <last-name>Mewes</last-name>
//    <opensocial-identifier nil="true"></opensocial-identifier>
//    <opensocial-identifier-hash type="integer">0</opensocial-identifier-hash>
//    <preferred-approval-screen>timeframe</preferred-approval-screen>
//    <preferred-entry-method>daily</preferred-entry-method>
//    <preferred-n8-account-id type="integer" nil="true"></preferred-n8-account-id>
//    <preferred-project-status-reports-screen>active</preferred-project-status-reports-screen>
//    <telephone></telephone>
//    <timezone>Berlin</timezone>
//    <twitter-username>Thommy</twitter-username>
//    <updated-at type="datetime">2010-10-19T07:06:57Z</updated-at>
//    <wants-newsletter type="boolean">true</wants-newsletter>
//    <wants-timesheet-duplication type="boolean">false</wants-timesheet-duplication>
//  </user>

    /// <summary>
    /// 
    /// </summary>
    /// <remarks>
    /// Don't change the XmlElement attributes, otherwise (de)serialization will fail.
    /// </remarks>
    [XmlRoot(ElementName = "user", IsNullable = false)]
    public class UserItem
    {

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "id", IsNullable = true)]
        public NullableInt Id { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "email")]
        public string Email { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "first-name")]
        public string FirstName { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "last-name")]
        public string LastName { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "has-access-to-all-future-projects", DataType = "boolean")]
        public bool HasAccessToAllFutureProjects { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "default-hourly-rate", IsNullable = true)]
        public NullableDouble DefaultHourlyRate { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "is-active", DataType = "boolean")]
        public bool IsActive { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "is-admin", DataType = "boolean")]
        public bool IsAdmin { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "is-contractor", DataType = "boolean")]
        public bool IsContractor { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "telephone")]
        public string Telephone { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "department")]
        public string Department { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "timezone")]
        public string Timezone { get; set; }

    }

}
